6a7ecb27b42171b82958c047c7dc9a910505aa9a,src/org/jgroups/stack/ProtocolStack.java,ProtocolStack,destroy,#,528

Before Change



    public void destroy() {
        if(top_prot != null) {
            Configurator.destroyProtocolStack(getProtocols(), singleton_transports);           // destroys msg queues and threads
            
            /*
             *Do not null top_prot reference since we need recreation of channel properties (JChannel#getProperties)

After Change



    public void destroy() {
        if(top_prot != null) {
            for(Protocol prot: getProtocols()) {
                if(prot instanceof TP) {
                    TP transport=(TP)prot;
                    if(transport.isSingleton()) {
                        String singleton_name=transport.getSingletonName();
                        synchronized(singleton_transports) {
                            Tuple<TP, ProtocolStack.RefCounter> val=singleton_transports.get(singleton_name);
                            if(val != null) {
                                ProtocolStack.RefCounter counter=val.getVal2();
                                short num_inits=counter.decrementInitCount();
                                if(num_inits >= 1) {
                                    continue;
                                }
                                else
                                    singleton_transports.remove(singleton_name);
                            }